//
//  BN_MedalAndCommentView.m
//  BabyNow
//
//  Created by 刘泽琛 on 14-5-23.
//  Copyright (c) 2014年 iMobile. All rights reserved.
//

#import "BN_MedalAndCommentView.h"
#define Radius 12

@implementation BN_MedalAndCommentView

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
    }
    return self;
}

- (id)init {
    if (self = [super init]) {
        //
    }
    return self;
}

- (void)loadBtnView {
    
    // 包装班级/家长动态按钮
    UIColor *color = [UIColor colorWithRed:0 green:0.77 blue:0.06 alpha:1];
    
    self.toMedalBtn.frame =  CGRectMake(0, 0, 100, 26);
    self.toMedalBtn.tag = 1;
    self.toMedalBtn.backgroundColor = [UIColor whiteColor];
    self.toMedalBtn.layer.cornerRadius = Radius;
    self.toMedalBtn.layer.masksToBounds = YES;
    
    self.toCommentBtn.frame = CGRectMake(102, 0, 100, 26);
    self.toCommentBtn.layer.cornerRadius = Radius;
    self.toCommentBtn.layer.masksToBounds = YES;
    self.toCommentBtn.tag = 2;
    
    self.toMedalBtn.titleLabel.font = [UIFont systemFontOfSize:15];
    self.toCommentBtn.titleLabel.font = [UIFont systemFontOfSize:15];
    [self.toMedalBtn setTitle:@"发勋章" forState:UIControlStateNormal];
    [self.toMedalBtn setTitleColor:color forState:UIControlStateNormal];
    [self.toMedalBtn addTarget:self action:@selector(classClick) forControlEvents:UIControlEventTouchUpInside];
    
    [self.toCommentBtn setTitle:@"  写评语" forState:UIControlStateNormal];
    self.toCommentBtn.titleLabel.textAlignment = NSTextAlignmentLeft;
    [self.toCommentBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [self.toCommentBtn addTarget:self action:@selector(parentClick) forControlEvents:UIControlEventTouchUpInside];
    
    //包装班级动态 和 家长动态 按钮的UIView
    self.backgroundView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 180, 26)];
    [self.backgroundView addSubview:self.toMedalBtn];
    [self.backgroundView addSubview:self.toCommentBtn];
    
    self.backgroundView.layer.cornerRadius = Radius;
    self.backgroundView.layer.masksToBounds = YES;
    self.backgroundView.layer.borderWidth = 0;
    self.backgroundView.layer.borderColor = [[UIColor whiteColor] CGColor];
    self.backgroundView.backgroundColor = [UIColor clearColor];
    [self addSubview:self.backgroundView];
}


#pragma mark 按钮的点击方法
- (void)classClick {
    // code...
}

- (void)parentClick {
    // code...
}

- (void)bottonClickState {
    // code...
}

- (void)dealloc
{
    // code...
}
@end
